package com.czxy.client;

import com.czxy.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用web-service接口   fallback：回调函数
 * @author Liuyunqin 17674029449@163.com
 * @date 2018/12/17 17:33
 */
@FeignClient(value = "web-service",fallback = UserClientFallback.class)
public interface UserClient {

    /**
     * 定义接口与web-service相应：根据电话号码和密码查询用户（远程调用web-service）
     * @param mobile
     * @param password
     * @return
     */
    @GetMapping("query")
    public ResponseEntity<User> findUserByMobile(@RequestParam("mobile") String mobile,@RequestParam("password") String password);


}
